﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Sispe.Entities;

namespace Sispe.Repository.Mapping
{
    public class LIQUIDACION_AREA_LIQUIDACIONMap:EntityTypeConfiguration<LIQUIDACION_AREA_LIQUIDACION>
    {
        public LIQUIDACION_AREA_LIQUIDACIONMap()
        {
            this.HasKey(t => t.Id);

            this.ToTable("LIQUIDACION_AREA_LIQUIDACION");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.IdLiquidacion).HasColumnName("IdLiquidacion");
            this.Property(t => t.IdAreaLiquidacion).HasColumnName("IdAreaLiquidacion");

            this.HasRequired(t => t.LIQUIDACION)
                .WithMany(t => t.LIQUIDACION_AREA_LIQUIDACION)
                .HasForeignKey(d => d.IdLiquidacion);
            this.HasRequired(t => t.AREA_LIQUIDACION)
                .WithMany(t => t.LIQUIDACION_AREA_LIQUIDACION)
                .HasForeignKey(d => d.IdAreaLiquidacion);
        }
    }
}
